package bepviet.android.engine;

import bepviet.android.ui.Home;
import bepviet.android.ui.ListAddMonAn;
import bepviet.android.ui.ListFavorite;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MainMenu extends Activity{
	private LinearLayout ln;
	private TextView menu_yeuthich,menu_trangchu,menu_lambep;
	public void onCreate(Bundle a) {
		super.onCreate(a);
		setContentView(R.layout.main_menu);				
		final Home home = new Home(this);		
		ln = (LinearLayout) findViewById(R.id.ln);
		ln.removeAllViews();
		ln.addView(home.getView());
		
		menu_trangchu = (TextView)findViewById(R.id.menu_trangchu);
		menu_yeuthich = (TextView)findViewById(R.id.menu_yeuthich);
		menu_lambep = (TextView)findViewById(R.id.menu_lambep);
		
		menu_trangchu.setOnClickListener(new View.OnClickListener() {			
			@Override
			public void onClick(View v) {				
				ln.removeAllViews();
				ln.addView(home.getView());
				
			}
		});		
		menu_lambep.setOnClickListener(new View.OnClickListener() {			
			@Override
			public void onClick(View v) {
				ListAddMonAn addMonAn = new ListAddMonAn(MainMenu.this);
				ln.removeAllViews();
				ln.addView(addMonAn.getView());
				
			}
		});		
		menu_yeuthich.setOnClickListener(new View.OnClickListener() {			
			@Override
			public void onClick(View v) {
				ListFavorite favorite = new ListFavorite(MainMenu.this);
				ln.removeAllViews();
				ln.addView(favorite.getView());
				
			}
		});		
		
		
		
	}

}
